package com.yonyou.cyxdms.sysAuth.service.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyxdms.sysAuth.service.entity.DealerInfoPO;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


/**
 * <p>
 * 经销商基本信息
 * </p>
 *
 * @author quankk
 * @since 2019-08-26
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class DealerInfoDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Integer dealerId;
    /**
     * 所属公司
     */
    private Integer companyId;
    /**
     * 所属集团
     */
    private Integer groupCompanyId;
    /**
     * 所属工厂公司
     */
    private Integer factoryCompanyId;
    /**
     * 组织ID
     */
    private Integer orgId;
    /**
     * 组织类型，固定为经销商类型
     */
    private Integer orgType;
    /**
     * 所有者代码
     */
    private String dealerCode;
    /**
     * 经销商名称
     */
    private String dealerName;
    /**
     * 经销商简称
     */
    private String dealerShortname;
    /**
     * DCS来源日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime sourceChangedAt;
    /**
     * 详细地址
     */
    private String address;
    /**
     * 省
     */
    private Integer provinceId;
    /**
     * 市
     */
    private Integer cityId;
    /**
     * 县
     */
    private Integer countyId;
    /**
     * 有效状态
     */
    private Integer validStatus;
    /**
     * 所有者的父组织代码（用于二网使用）
     */
    private String ownerParCode;
    /**
     * 联系电话
     */
    private String phone;
    /**
     * 是否授权
     */
    private Integer isAuz;
    /**
     * 税号
     */
    private String taxNo;
    /**
     * 传真号码
     */
    private String faxNo;
    /**
     * 联系人
     */
    private String linkMan;
    /**
     * 邮编
     */
    private String zipCode;
    /**
     * 是否黑名单
     */
    private Integer status;
    /**
     * 经销商类型：普通、军品、批售、改装、3S
     */
    private Integer agType;
    /**
     * 销售区域
     */
    private String saleArea;
    /**
     * 价格组
     */
    private Integer priceGroup;
    /**
     * 付款条件
     */
    private Integer payCond;
    /**
     * 库存标准设定
     */
    private String stockSet;
    /**
     * 业务邮箱
     */
    private String email;
    /**
     * 经度
     */
    private String latitude;
    /**
     * 维度
     */
    private String longitude;
    /**
     * 网点类型
     */
    private Integer dotType;
    /**
     * 分销商级别
     */
    private Integer distributorLevel;
    /**
     * 认证大客户代码
     */
    private String authCustCode;
    private Integer creditType;
    /**
     * 经销商营业状态
     */
    private Integer businessStatus;
    /**
     * 维修站ID
     */
    private Long ascId;
    private String businessBeginHours;
    private String businessEndHours;
    private String dealerPicture;
    /**
     * 维修站代码
     */
    private String ascCode;
    private Integer isDeleted;

    private List<DealerInfoPO> dealerList;

    public String getBusinessBeginHours() {
        return businessBeginHours;
    }

    public void setBusinessBeginHours(String businessBeginHours) {
        this.businessBeginHours = businessBeginHours;
    }

    public String getBusinessEndHours() {
        return businessEndHours;
    }

    public void setBusinessEndHours(String businessEndHours) {
        this.businessEndHours = businessEndHours;
    }

    public String getDealerPicture() {
        return dealerPicture;
    }

    public void setDealerPicture(String dealerPicture) {
        this.dealerPicture = dealerPicture;
    }

    public DealerInfoDTO() {
        super();
    }


    public Integer getDealerId() {
        return dealerId;
    }


    public void setDealerId(Integer dealerId) {
        this.dealerId = dealerId;
    }


    public Integer getCompanyId() {
        return companyId;
    }


    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }


    public Integer getGroupCompanyId() {
        return groupCompanyId;
    }


    public void setGroupCompanyId(Integer groupCompanyId) {
        this.groupCompanyId = groupCompanyId;
    }


    public Integer getFactoryCompanyId() {
        return factoryCompanyId;
    }


    public void setFactoryCompanyId(Integer factoryCompanyId) {
        this.factoryCompanyId = factoryCompanyId;
    }


    public Integer getOrgId() {
        return orgId;
    }


    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }


    public Integer getOrgType() {
        return orgType;
    }


    public void setOrgType(Integer orgType) {
        this.orgType = orgType;
    }


    public String getDealerCode() {
        return dealerCode;
    }


    public void setDealerCode(String dealerCode) {
        this.dealerCode = dealerCode;
    }


    public String getDealerName() {
        return dealerName;
    }


    public void setDealerName(String dealerName) {
        this.dealerName = dealerName;
    }


    public String getDealerShortname() {
        return dealerShortname;
    }


    public void setDealerShortname(String dealerShortname) {
        this.dealerShortname = dealerShortname;
    }


    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }


    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }


    public String getAddress() {
        return address;
    }


    public void setAddress(String address) {
        this.address = address;
    }


    public Integer getProvinceId() {
        return provinceId;
    }


    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }


    public Integer getCityId() {
        return cityId;
    }


    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }


    public Integer getCountyId() {
        return countyId;
    }


    public void setCountyId(Integer countyId) {
        this.countyId = countyId;
    }


    public Integer getValidStatus() {
        return validStatus;
    }


    public void setValidStatus(Integer validStatus) {
        this.validStatus = validStatus;
    }


    public String getOwnerParCode() {
        return ownerParCode;
    }


    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }


    public String getPhone() {
        return phone;
    }


    public void setPhone(String phone) {
        this.phone = phone;
    }


    public Integer getIsAuz() {
        return isAuz;
    }


    public void setIsAuz(Integer isAuz) {
        this.isAuz = isAuz;
    }


    public String getTaxNo() {
        return taxNo;
    }


    public void setTaxNo(String taxNo) {
        this.taxNo = taxNo;
    }


    public String getFaxNo() {
        return faxNo;
    }


    public void setFaxNo(String faxNo) {
        this.faxNo = faxNo;
    }


    public String getLinkMan() {
        return linkMan;
    }


    public void setLinkMan(String linkMan) {
        this.linkMan = linkMan;
    }


    public String getZipCode() {
        return zipCode;
    }


    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }


    public Integer getStatus() {
        return status;
    }


    public void setStatus(Integer status) {
        this.status = status;
    }


    public Integer getAgType() {
        return agType;
    }


    public void setAgType(Integer agType) {
        this.agType = agType;
    }


    public String getSaleArea() {
        return saleArea;
    }


    public void setSaleArea(String saleArea) {
        this.saleArea = saleArea;
    }


    public Integer getPriceGroup() {
        return priceGroup;
    }


    public void setPriceGroup(Integer priceGroup) {
        this.priceGroup = priceGroup;
    }


    public Integer getPayCond() {
        return payCond;
    }


    public void setPayCond(Integer payCond) {
        this.payCond = payCond;
    }


    public String getStockSet() {
        return stockSet;
    }


    public void setStockSet(String stockSet) {
        this.stockSet = stockSet;
    }


    public String getEmail() {
        return email;
    }


    public void setEmail(String email) {
        this.email = email;
    }


    public String getLatitude() {
        return latitude;
    }


    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }


    public String getLongitude() {
        return longitude;
    }


    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }


    public Integer getDotType() {
        return dotType;
    }


    public void setDotType(Integer dotType) {
        this.dotType = dotType;
    }


    public Integer getDistributorLevel() {
        return distributorLevel;
    }


    public void setDistributorLevel(Integer distributorLevel) {
        this.distributorLevel = distributorLevel;
    }


    public String getAuthCustCode() {
        return authCustCode;
    }


    public void setAuthCustCode(String authCustCode) {
        this.authCustCode = authCustCode;
    }


    public Integer getCreditType() {
        return creditType;
    }


    public void setCreditType(Integer creditType) {
        this.creditType = creditType;
    }


    public Integer getBusinessStatus() {
        return businessStatus;
    }


    public void setBusinessStatus(Integer businessStatus) {
        this.businessStatus = businessStatus;
    }


    public Long getAscId() {
        return ascId;
    }


    public void setAscId(Long ascId) {
        this.ascId = ascId;
    }


    public String getAscCode() {
        return ascCode;
    }


    public void setAscCode(String ascCode) {
        this.ascCode = ascCode;
    }


    public Integer getIsDeleted() {
        return isDeleted;
    }


    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public List<DealerInfoPO> getDealerList() {
        return dealerList;
    }

    public void setDealerList(List<DealerInfoPO> dealerList) {
        this.dealerList = dealerList;
    }

    @Override
    public String toString() {
        return "DealerInfoDTO{" +
                "dealerId=" + dealerId +
                ", companyId=" + companyId +
                ", groupCompanyId=" + groupCompanyId +
                ", factoryCompanyId=" + factoryCompanyId +
                ", orgId=" + orgId +
                ", orgType=" + orgType +
                ", dealerCode=" + dealerCode +
                ", dealerName=" + dealerName +
                ", dealerShortname=" + dealerShortname +
                ", sourceChangedAt=" + sourceChangedAt +
                ", address=" + address +
                ", provinceId=" + provinceId +
                ", cityId=" + cityId +
                ", countyId=" + countyId +
                ", validStatus=" + validStatus +
                ", ownerParCode=" + ownerParCode +
                ", phone=" + phone +
                ", isAuz=" + isAuz +
                ", taxNo=" + taxNo +
                ", faxNo=" + faxNo +
                ", linkMan=" + linkMan +
                ", zipCode=" + zipCode +
                ", status=" + status +
                ", agType=" + agType +
                ", saleArea=" + saleArea +
                ", priceGroup=" + priceGroup +
                ", payCond=" + payCond +
                ", stockSet=" + stockSet +
                ", email=" + email +
                ", latitude=" + latitude +
                ", longitude=" + longitude +
                ", dotType=" + dotType +
                ", distributorLevel=" + distributorLevel +
                ", authCustCode=" + authCustCode +
                ", creditType=" + creditType +
                ", businessStatus=" + businessStatus +
                ", ascId=" + ascId +
                ", ascCode=" + ascCode +
                ", isDeleted=" + isDeleted +
                "}";
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author quankk
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "dealerId");
    }

}
